{extend name='public/base' /}
{block name='content'}
{include file='public/content_header' /}
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">
                <!-- 表单头部 -->
                <div class="box-header with-border">
                    <div class="btn-group">
                        <a class="btn flat btn-sm btn-default BackButton">
                            <i class="fa fa-arrow-left"></i>
                            返回
                        </a>
                    </div>
                </div>
                <!-- 表单 -->
                <form id="dataForm" class="form-horizontal dataForm" action="" method="post" enctype="multipart/form-data">
                    <!-- 表单字段区域 -->
                    <div class="box-body">
                        <div class="form-group">
                            <label for="uid" class="col-sm-2 control-label">粉丝ID</label>
                            <div class="col-sm-10 col-md-4">
                                <select name="uid" id="uid" class="form-control field-select" data-placeholder="请选择所属粉丝">
                                    <option value="">请选择...</option>
                                    {foreach name="use" item="vo"}
                                    <option value="{$vo.id}" {if condition="$vo.id eq $data.uid"}selected{/if}>{$vo.username}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="type" class="col-sm-2 control-label">
                                类型
                                <!--1 淘宝 2京东 3拼多多-->
                            </label>
                            <div class="col-sm-10 col-md-4" style="padding:5px;">&nbsp;
                                <input type="radio" name="type" value="1" {if isset($data) && $data.type==1} checked {/if} />&nbsp;淘宝&nbsp;
                                <input type="radio" name="type" value="2" {if isset($data) && $data.type==2} checked {/if} />&nbsp;京东&nbsp;
                                <input type="radio" name="type" value="3" {if isset($data) && $data.type==3} checked {/if} />&nbsp;拼多多&nbsp;
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="tao_name" class="col-sm-2 control-label">买号</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="tao_name" name="tao_name" value="{$data.tao_name|default=''}" placeholder="请输入买号" type="text" class="form-control field-text">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="alipay_pic" class="col-sm-2 control-label">支付截图</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="alipay_pic" name="alipay_pic"  placeholder="请上传支付宝截图" data-initial-preview="{$data.alipay_pic|default=''}" type="file" class="form-control field-image" >
                            </div>
                        </div>
                        <script>
                            $('#alipay_pic').fileinput({
                                language: 'zh',
                                overwriteInitial: true,
                                browseLabel: '浏览',
                                initialPreviewAsData: true,
                                dropZoneEnabled: false,
                                showUpload:false,
                                showRemove: false,
                                allowedFileTypes:['image'],
                                maxFileSize:10240,
                            });
                        </script>
                        <div class="form-group">
                            <label for="appraise_pic" class="col-sm-2 control-label">评价截图</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="appraise_pic" name="appraise_pic"  placeholder="请上传评价管理截图" data-initial-preview="{$data.appraise_pic|default=''}" type="file" class="form-control field-image" >
                            </div>
                        </div>
                        <script>
                            $('#appraise_pic').fileinput({
                                language: 'zh',
                                overwriteInitial: true,
                                browseLabel: '浏览',
                                initialPreviewAsData: true,
                                dropZoneEnabled: false,
                                showUpload:false,
                                showRemove: false,
                                allowedFileTypes:['image'],
                                maxFileSize:10240,
                            });
                        </script>
                        <div class="form-group">
                            <label for="address_pic" class="col-sm-2 control-label">地址</label>
                            <div class="col-sm-10 col-md-4">
                                <input id="address_pic" name="address_pic"  placeholder="请上传评价管理截图" data-initial-preview="{$data.address_pic|default=''}" type="file" class="form-control field-image" >
                            </div>
                        </div>
                        <script>
                            $('#address_pic').fileinput({
                                language: 'zh',
                                overwriteInitial: true,
                                browseLabel: '浏览',
                                initialPreviewAsData: true,
                                dropZoneEnabled: false,
                                showUpload:false,
                                showRemove: false,
                                allowedFileTypes:['image'],
                                maxFileSize:10240,
                            });
                        </script>

                    </div>
                    <!-- 表单底部 -->
                    <div class="box-footer">
                        {:token()}
                        <div class="col-sm-2">
                        </div>
                        <div class="col-sm-10 col-md-4">
                            {if !isset($data)}
                            <div class="btn-group pull-right">
                                <label class="createContinue">
                                    <input type="checkbox" value="1" id="_create" name="_create"
                                           title="继续添加数据">继续添加</label>
                            </div>
                            {/if}
                            <div class="btn-group">
                                <button type="submit" class="btn flat btn-info dataFormSubmit">
                                    保存
                                </button>
                            </div>
                            <div class="btn-group">
                                <button type="reset" class="btn flat btn-default dataFormReset">
                                    重置
                                </button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</section>
<script>
    /** 表单验证 **/
    $('#dataForm').validate({
        rules: {
            'uid': {
                required: true,
            },
            'tao_name': {
                required: true,
            },

        },
        messages: {
            'uid': {
                required: "粉丝id不能为空",
            },
            'tao_name': {
                required: "买号不能为空",
            },

        }
    });
</script>
{/block}